import {getRequest, postRequest} from "@/util/axios";

/**
 * 分页获取用户
 * @param user
 * @returns {Promise<*>}
 */
export const getUserByPage = (user)=>postRequest('/user/getUserByPage',user);
/**
 * 添加用户
 * @param user
 * @returns {Promise<*>}
 */
export const addUser = (user)=>postRequest('/user/add',user);
/**
 * 更新用户
 * @param user
 * @returns {Promise<unknown>}
 */
export const updateUser = (user)=>postRequest('/user/update',user);

/**
 * 删除用户
 * @param id
 * @returns {Promise<*>}
 */
export const deleteUser = (id)=>getRequest('/user/remove',{id});


export const getAllUser = ()=>getRequest('/user/getAllUser');
/**
 * 用户登陆
 * @param user
 * @returns {Promise<*>}
 */
export const login = (user) =>postRequest('/user/login',user);
